﻿using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XNA_TD.Shells
{
    public class RocketParticle : SquarePointSprite, IGameUpdate
    {
        long startTime;

        public RocketParticle(Vector3 pos, float scale)
            : base(pos, scale, new Vector4(1, 0.1f, 0, .2f), "Linear")
        {
            startTime = inGameTime;
        }

        public void GameUpdate()
        {
            color.W = 1 - (inGameTime - startTime) / 256f;
            scale = color.W + .1f;
            if (color.W <= 0)
                UnRegister(this);
        }
    }
}
